package com.juyu.miliao.common.exception;

import java.util.HashMap;
import java.util.Map;

/**
 * 参数错误
 * @author zhangcheng
 *
 */
public class IllegalParamException extends RuntimeException{
	private static final long serialVersionUID = 8232514994688295868L;
	private Map<String, String> detail;

	public IllegalParamException(String msg){
		super(msg);
	}
	
	public IllegalParamException(String msg, String fieldName, String errorMsg){
		super(msg);
		detail = new HashMap<>();
		detail.put(fieldName, errorMsg);
	}

	public IllegalParamException(String fieldName, String errorMsg){
		super("参数不合法");
		detail = new HashMap<>();
		detail.put(fieldName, errorMsg);
	}
	
	public Map<String, String> getDetail() {
		return detail;
	}
	
}
